{include file="public/toper" /}
<div class="x-nav">
    <span class="layui-breadcrumb">
        <a href="">运营中心</a>
        <a><cite>二级佣金订单</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">&#xe666;</i></a>
</div>
<div class="x-body">
    <!--<div class="layui-row">-->
        <!--<div class="layui-form layui-col-md12 x-so">-->
            <!--<input type="text" name="sreach" value=""  style="width:250px;" id="key"   placeholder="订单号" autocomplete="off" class="layui-input">-->
            <!--<div class="layui-input-inline">-->
                <!--<select name="type" id="type">-->
                    <!--<option value=".">全部</option>-->
                    <!--<option value="0">未结算</option>-->
                    <!--<option value="1">已结算</option>-->
                <!--</select>-->
            <!--</div>-->
            <!--<button class="layui-btn" id="search"><i class="layui-icon">&#xe615;</i></button>-->
        <!--</div>-->
    <!--</div>-->
    <table class="layui-hide" id="test" lay-filter="test"></table>
</div>

<script type="text/html" id="sn">
    {{#  if(d.type==1){ }}
    <div><a href="#"  onclick="x_admin_show('查看订单','{:url(\'Order/order_details\')}?id={{d.order_id}}')" title="查看详情" class="layui-table-link">{{d.order_sn}}</a></div>
    {{#  } else if(d.type==2) { }}
    <div><a href="#"  onclick="x_admin_show('查看订单','{:url(\'Corder/edit\')}?id={{d.order_id}}')" title="查看详情" class="layui-table-link">{{d.order_sn}}</a></div>
    {{#  } }}
</script>
<script>
    layui.use(['table','util','layer','laydate'], function(){
        var table = layui.table, $ = layui.jquery;
        var layer = layui.layer;
        var laydate = layui.laydate;
        var loading = layer.load(1, {shade: [0.1,'#fff'] });
        var tableIn = table.render({
            method: 'post',
            elem: '#test'
            ,url: "{:url('Order/two')}"
            ,id:'test'
            ,cols: [[
                {field:'commissions_id', width:80, title: '序号',align: 'center',type:'numbers'}
                ,{width:180, title: '订单号',align: 'center',totalRowText:'合计',templet:'#sn'}
                ,{field:'name',width: 150,title: '用户', align: 'center'}
                ,{field:'uname',width: 150,title: '上上级', align: 'center'}
                ,{field:'upper_level_commission',width: 80,title: '佣金', align: 'center'}
                ,{field:'distribution_settlement', width:100, title: '是否结算',align: 'center',templet: function(d){if(d.distribution_settlement==0){return '未结算';}else if(d.distribution_settlement==1){return '已结算';}}}
                ,{field:'add_time', width:180, title: '下单时间',align: 'center',templet: '<div>{{layui.util.toDateString(d.add_time*1000)}}</div>'}
                ,{field:'end_time', width:180, title: '完成时间',align: 'center',templet: '<div>{{layui.util.toDateString(d.end_time*1000)}}</div>'}
            ]]
            ,page:true
            ,limit: 30
            ,limits:[30,60,90,120,150,180,210,240,270,300]
            //,totalRow:true
        });
        layer.close(loading);

        $('#search').on('click', function () {
            tableIn.reload({
                where: {key: $('#key').val(),type:$('#type').val()}
                ,page: {curr: 1 }
            });
        });
    });
</script>
{include file="public/footer"/}